<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>15-modules</title>
    </head>
    <body>
        <div id="app">
        </div>
        <script src='../js/vue.js'></script>
        <script src="../js/vuex.js"></script>
        <script>
            const module1={
                state:{
                    count:1
                },
                mutations:{

                },
                getters:{

                },
                actions:{}
            }
            const module2={
                state: {
                    type:true,
                    name:"lili"
                },
                mutations: {

                },
                getters: {

                },
                actions: {}
            }

            let store=new Vuex.Store({
                modules:{a:module1,b:module2}
            })

            let vm = new Vue({
                el: "#app",
                data: {},
                store,
                mounted(){
                    console.log(this.$store.state.a.count);
                    console.log(this.$store.state.b.name);
                }
            });
        </script>
    </body>
</html>